<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta content="telephone=no" name="format-detection" />
  <title>联考报名成功</title>
  <meta itemprop="name" content="这场被誉为“小高考”的联考，为啥吸引上百万考生？" />
  <meta itemprop="image" content="img/share-icon.jpg" />
  <meta name="description" itemprop="description" content="一百万高考生报名参加这场“小高考”超级全能生联考被刷屏炒火了！" />
  <link rel="stylesheet" href="/css/reset.css">
  <link rel="stylesheet" href="/css/normalize.css">
  <link rel="stylesheet" href="/css/lk/successful.css">
  <style>
    .bg {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
    }

    .bg .modal {
      background: #FFF;
      width: 6rem;
      height: 2rem;
      line-height: 0.6rem;
      padding: 0.4rem 0;
      font-size: 0.46rem;
      text-align: center;
      margin: 0 auto;
      margin-top: 2rem;
      box-sizing: border-box;
    }
  </style>
  <% include ../component/_common_tongji.html %>  
  <script>
    var imgs = ['/img/7_031.jpg', '/img/7_01.png', '/img/7_04.jpg', '/img/7_05.jpg', '/img/7_02.jpg']
    var len = imgs.length;
    while (len--) {
      var image = new Image();
      image.onload = function () {
        image.src = imgs[len];
      }
    }
  </script>
  <script>
    var token = window.localStorage.getItem('token');
    if (!token) {
      if (location.search != "") {
        location.replace('/lk' + location.search + "&o=share");
      } else {
        location.replace('/lk?o=share');
      }
    }
  </script>
  <script>
    ! function (e) {
      function t(a) {
        if (i[a]) return i[a].exports;
        var n = i[a] = {
          exports: {},
          id: a,
          loaded: !1
        };
        return e[a].call(n.exports, n, n.exports, t), n.loaded = !0, n.exports
      }
      var i = {};
      return t.m = e, t.c = i, t.p = "", t(0)
    }([function (e, t) {
      "use strict";
      Object.defineProperty(t, "__esModule", {
        value: !0
      });
      var i = window;
      t["default"] = i.flex = function (normal, e, t) {
        var a = e || 100,
          n = t || 1,
          r = i.document,
          o = navigator.userAgent,
          d = o.match(/Android[\S\s]+AppleWebkit\/(\d{3})/i),
          l = o.match(/U3\/((\d+|\.){5,})/i),
          c = l && parseInt(l[1].split(".").join(""), 10) >= 80,
          p = navigator.appVersion.match(/(iphone|ipad|ipod)/gi),
          s = i.devicePixelRatio || 1;
        p || d && d[1] > 534 || c || (s = 1);
        var u = normal ? 1 : 1 / s,
          m = r.querySelector('meta[name="viewport"]');
        m || (m = r.createElement("meta"), m.setAttribute("name", "viewport"), r.head.appendChild(m)), m.setAttribute(
          "content", "width=device-width,user-scalable=no,initial-scale=" + u + ",maximum-scale=" + u +
          ",minimum-scale=" + u), r.documentElement.style.fontSize = normal ? "50px" : a / 2 * s * n + "px"
      }, e.exports = t["default"]
    }]);
    flex(false, 100, 1);
  </script>
</head>

<body>
  <div class="content">
    <div class="success">
      <img src="/img/7_031.jpg" alt="">
      <div class="bot">
        <p class="successEnter">恭喜你已经报名成功!</p>
        <p>请尽快加入联考社群，核实身份参与考试</p>
        <p>QQ群号：701820219</p>
        <a href="https://jq.qq.com/?_wv=1027&k=52yczin">
          <img src="/img/7_01.png">快速进群</a>
      </div>
    </div>
    <div class="receive">
      <img src="/img/7_05.jpg" alt="领取奖金" class="hrefImg">
      <p>成功邀请多名好友报名可累计更多助学金哟！</p>
      <a href="javascript:;" class="hrefImg">
        <img src="/img/7_02.png" alt="" class="share"> 分享我的专属链接</a>
    </div>
    <div class="qrcode">
      <img src="/img/7_04.jpg">
    </div>
  </div>
  <!-- 分享图片 -->
  <div class="shareImg" style="display:none">
    <div id="sharePic" class="wrap">
      <img id="img" style="width:100%;display:block;border:0;" src="">
    </div>
    <div class="bg">
      <div class="modal">
        长按保存图片
        <br> 发送好友或分享朋友圈
      </div>
    </div>
  </div>
  <script src="https://sfile.tl100.com/js/libs/axios.min.js"></script>
  <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  <script>
    // 点击显示图片
    var hrefImg = document.querySelectorAll('.hrefImg');
    hrefImg.forEach(function (ele) {
      ele.onclick = function () {
        //this.href = 'share?id='+id;
        clearTimeout(timer);
        document.querySelector('.shareImg').style.display = "block";
        document.querySelector('.content').style.display = 'none';
        var timer = setTimeout(function () {
          document.getElementsByClassName('bg')[0].style.display = 'none';
        }, 3500);
      }
    })

    var api = axios.create({
      baseURL: 'https://api.tl100.com/exam_signup',
      withCredentials: true,
      timeout: 5000
    });
    function getUserInfo () {
      api.post('api/sign_up/getUserSignUp', {
        token: localStorage.getItem('token')
      }).then(function (res) {
        console.log(res)
        if(res.data.res_code == 0) {
          location.replace("/lk/signup");
        }
        if (res.data.res_code < 0) {
          localStorage.removeItem("token");
          setLog('api/sign_up/getUserSignUp:fail', JSON.stringify(res.data));
        }
        if(res.data.msg.state <= 0) {
          location.replace("/lk/signup");
        }
      }).catch(function (error) {
        setLog('api/sign_up/getUserSignUp:catch', JSON.stringify(error));
      });
    }
    getUserInfo()

    // 获取图片
    var ch = document.documentElement.clientHeight;
    document.getElementsByClassName('modal')[0].style['margin-top'] = (ch / 2 - 100) + "px";

    api.post('/api/user/getShareImage', {
      token: token
    }).then(function (res) {
      console.log(res);
      var id = res.data.msg.split('/')[res.data.msg.split('/').length - 1];
      var date = new Date();
      var time = date.getTime();
      document.getElementById('img').src = res.data.msg + '?' + time;
      var WxApi = axios.create({
        baseURL: 'https://api.tl100.com/user',
        withCredentials: true,
        timeout: 5000
      });
      //微信签名
      WxApi.post('api/weixin/getXGKJJssdkSign', {
        url: location.href
      }).then(function (res) {
        wx.config({
          debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
          appId: res.data.app_id, // 必填，公众号的唯一标识
          timestamp: res.data.timestamp, // 必填，生成签名的时间戳
          nonceStr: res.data.nonceStr, // 必填，生成签名的随机串
          signature: res.data.sign, // 必填，签名
          jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ'] // 必填，需要使用的JS接口列表
        });
        wx.ready(function () {
          var shareUrl = "https://m.tl100.com/lk/share?id=" + id;
          wx.onMenuShareAppMessage({
            title: '这场被誉为“小高考”的联考，为啥吸引上百万考生？', // 分享标题
            desc: '一百万高考生报名参加这场“小高考”超级全能生联考被刷屏炒火了！', // 分享描述
            link: shareUrl + "&st=wx_qun", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: 'img/share-icon.jpg', // 分享图标
            type: 'link', // 分享类型,music、video或link，不填默认为link
            dataUrl: ''
          });
          wx.onMenuShareTimeline({
            title: '这场被誉为“小高考”的联考，为啥吸引上百万考生？', // 分享标题
            link: shareUrl + "&st=wx_timeline", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: 'img/share-icon.jpg'
          });
          wx.onMenuShareQQ({
            title: '这场被誉为“小高考”的联考，为啥吸引上百万考生？', // 分享标题
            desc: '一百万高考生报名参加这场“小高考”超级全能生联考被刷屏炒火了！', // 分享描述
            link: shareUrl + "&st=qq", // 分享链接
            imgUrl: 'img/share-icon.jpg'
          });
        });
      })
    });
  </script>
</body>

</html>